<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>修改商品</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="css/add_goods.css">
	<script type="text/javascript">
		
		/* 校验  */
		function losefocus1(){
		
			if(document.getElementById("detailsId").value==""){
				document.getElementById("null_span1").innerText="商品详情不能为空";
			}
				
		}
	    function getfocus1(){
		
			
			document.getElementById("null_span1").innerText="";
			
				
		}	
		function losefocus2(){
		
			if(document.getElementById("sizeId").value==""){
				document.getElementById("null_span2").innerText="尺寸不能为空";
			}
				
		}
	    function getfocus2(){
		
			
			document.getElementById("null_span2").innerText="";
			
				
		}	
		function losefocus3(){
		
			if(document.getElementById("colorId").value==""){
				document.getElementById("null_span3").innerText="颜色不能为空";
			}
				
		}
	    function getfocus3(){
		
			
			document.getElementById("null_span3").innerText="";
			
				
		}	
		function losefocus4(){
		
			if(document.getElementById("numId").value==""){
				document.getElementById("null_span4").innerText="数量不能为空";
			}
				
		}
	    function getfocus4(){
		
			
			document.getElementById("null_span4").innerText="";
			
				
		}	
		
		function losefocus5(){
		
			if(document.getElementById("all_priceId").value==""){
				document.getElementById("null_span5").innerText="价格不能为空";
			}
				
		}
	    function getfocus5(){
					
			document.getElementById("null_span5").innerText="";
				
		}	
		
		function losefocus6(){
		
			if(document.getElementById("nameId").value==""){
				document.getElementById("null_span6").innerText="姓名不能为空";
			}
				
		}
	    function getfocus6(){
					
			document.getElementById("null_span6").innerText="";
				
		}	
		
		function losefocus7(){
		
			if(document.getElementById("phoneId").value==""){
				document.getElementById("null_span7").innerText="电话不能为空";
			}
				
		}
	    function getfocus7(){
					
			document.getElementById("null_span7").innerText="";
				
		}	
		
		
		
		function losefocus8(){
		
			if(document.getElementById("addressId").value==""){
				document.getElementById("null_span8").innerText="地址不能为空";
			}
				
		}
	    function getfocus8(){
					
			document.getElementById("null_span8").innerText="";
				
		}	
		function losefocus9(){
		
			if(document.getElementById("dateId").value==""){
				document.getElementById("null_span9").innerText="日期不能为空";
			}
				
		}
	    function getfocus9(){
					
			document.getElementById("null_span9").innerText="";
				
		}	
		function losefocus10(){
		
			if(document.getElementById("timeId").value==""){
				document.getElementById("null_span10").innerText="时间不能为空";
			}
				
		}
	    function getfocus10(){
					
			document.getElementById("null_span10").innerText="";
				
		}	
		function losefocus11(){
		
			if(document.getElementById("order_numberId").value==""){
				document.getElementById("null_span11").innerText="订单号不能为空";
			}
				
		}
	    function getfocus11(){
					
			document.getElementById("null_span11").innerText="";
				
		}	
		
		
		
		function jiaoyan_all(){
			var bol=true;
			
	
			if(document.getElementById("detailsId").value==""){
				bol=false;
				alert("商品详情不能为空");
			}else if(document.getElementById("sizeId").value==""){
				bol=false;
				alert("尺寸不能为空");
			}else if(document.getElementById("colorId").value==""){
				bol=false;
				alert("颜色不能为空");
			}else if(document.getElementById("numId").value==""){
				bol=false;
				alert("数量不能为空");
			}else if(document.getElementById("all_priceId").value==""){
				bol=false;
				alert("价格不能为空");
			}else if(document.getElementById("nameId").value==""){
				bol=false;
				alert("姓名不能为空");
			}else if(document.getElementById("phoneId").value==""){
				bol=false;
				alert("电话不能为空");
			}else if(document.getElementById("addressId").value==""){
				bol=false;
				alert("地址不能为空");
			}else if(document.getElementById("dateId").value==""){
				bol=false;
				alert("日期不能为空");
			}else if(document.getElementById("timeId").value==""){
				bol=false;
				alert("时间不能为空");
			}else if(document.getElementById("order_numberId").value==""){
				bol=false;
				alert("订单号不能为空");
			}
			
			
			
			return bol;
		}
		
		function success() {
			alert("更新成功");
		
		}
	</script>

  </head>
  
  <body>
  	<!--总div  -->
     <div class="div_all">
     	<div class="div_2">
     		<!-- 添加div -->
     		<div class="div_add" style="width:800px;height:1000px;">
	     		<form action="update_order.do" method="post" enctype="multipart/form-data" onsubmit="return jiaoyan_all()" >
	     		
	     			<div style="margin-top:30px;">商品详情:<input value="${orders.details}" type="text" name="details" id="detailsId" onblur="losefocus1()" onfocus="getfocus1()"/><br/><span class="jiaoyan" id="null_span1"></span></div>	 
	     			
	     			<div>尺寸:<input value="${orders.size}" type="text" name="size" id="sizeId" onblur="losefocus2()"onfocus="getfocus2()"/><br/><span class="jiaoyan" id="null_span2"></span></div><br/>
	     			
	     			<div>颜色:<input value="${orders.color}" type="text" name="color" id="colorId" onblur="losefocus3()"onfocus="getfocus3()"/><br/><span class="jiaoyan" id="null_span3"></span></div><br/>
	     		
	     		    <div>数量:<input value="${orders.num}"  type="text" name="num"  id="numId" onblur="losefocus4()"onfocus="getfocus4()"/><br/><span class="jiaoyan" id="null_span4"></span></div><br/>
	 	     			
	     			<div>共计:<input value="${orders.all_price}" type="text" name="all_price" id="all_priceId" onblur="losefocus5()" onfocus="getfocus5()" /><br/><span class="jiaoyan" id="null_span5"></span></div>
	     			
	     			<div>姓名:<input value="${orders.name}" type="text" name="name" id="nameId" onblur="losefocus6()" onfocus="getfocus6()" /><br/><span class="jiaoyan" id="null_span6"></span></div>
	     			
	     			<div>性别:<select name="sex" id="sexId">
	     						<option>${orders.sex}</option>
	     						<%if("男".equals(request.getAttribute("sex"))){%>
	     						<option>女</option>
	     						<%} %>
	     						<%if("女".equals(request.getAttribute("sex"))){%>
	     						<option>男</option>
	     						<%} %>
	     					</select>
	     			</div>
	     			<div>电话:<input value="${orders.phone}" type="text" name="phone" id="phoneId" onblur="losefocus7()" onfocus="getfocus7()" /><br/><span class="jiaoyan" id="null_span7"></span></div>
	     			
	     			<div>地址:<input value="${orders.address}" type="text" name="address" id="addressId" onblur="losefocus8()" onfocus="getfocus8()" /><br/><span class="jiaoyan" id="null_span8"></span></div>
	     			
	     			<div>日期:<input value="${orders.date}" type="text" name="date" id="dateId" onblur="losefocus9()" onfocus="getfocus9()" /><br/><span class="jiaoyan" id="null_span9"></span></div>
	     			
	     			<div>时间:<input value="${orders.time}" type="text" name="time" id="timeId" onblur="losefocus10()" onfocus="getfocus10()" /><br/><span class="jiaoyan" id="null_span10"></span></div>
	     			
	     			<div>订单号:<input value="${orders.order_number}" type="text" name="order_number" id="order_numberId" onblur="losefocus11()" onfocus="getfocus11()" /><br/><span class="jiaoyan" id="null_span11"></span></div>
	     			
	     			
	     			<input type="hidden" name="id" value="${orders.id}">
	     			<input type="submit" value="确定" style="width:60px; height:30px;margin:120px 50px;" class="Mysubmit" onclick="success()"/>
	     		</form>
     		</div>
     	</div>
     	
     </div>
  </body>
</html>
